Skip to content

Rename the react.element symbol to react.transitional.element#28813

Merged
sebmarkbage merged 2 commits intofacebook:mainfrom
sebmarkbage:renameelement
Apr 22, 2024
Merged

Rename the react.element symbol to react.transitional.element#28813
sebmarkbage merged 2 commits intofacebook:mainfrom
sebmarkbage:renameelement

Conversation

@sebmarkbage
Copy link
Copy Markdown
Contributor

@sebmarkbage sebmarkbage commented Apr 10, 2024

We have changed the shape (and the runtime) of React Elements. To help avoid precompiled or inlined JSX having subtle breakages or deopting hidden classes, I renamed the symbol so that we can early error if private implementation details are used or mismatching versions are used. The fix is usually to stop inlining the JSX runtime e.g. by configuring the bundler to treat react/jsx-runtime and react/jsx-dev-runtime as externals.

This also catches using a version of react-is that's not the same as react. react-is must be the same version as react.

Why "transitional"? Well, because this is not the last time we'll change the shape. This is just a stepping stone to removing the ref field on the elements in the next version so we'll likely have to do it again.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants